<template>
    <view style="margin-top: 100px;">
        <lv-select
        @handleSearch = "handleSearch"
        @change = "change"
        placeholder = "请输入支行关键字"
        :infoList = "infoList"
        :showValue = "showValue"
        v-model = "searchValue"
        :loading = "loading"
        type = "error"
        :uniShadow = "true"
        ></lv-select>
    </view>
</template>
<script>
    import lvSelect from '../../components/lv-select/lv-select.vue'
    export default {
        components:{lvSelect},
        data() {
            return {
                loading: false,
                showValue: 'name', // 需要显示的数据，必须与infoList中的name对应
                searchValue: '',
                infoList: [],
                infoLists: [{
                    name: '吕星辰1',
					id:1
                },{
                    name: '吕星辰2',
					id:2
                },{
                    name: '吕星辰3',
					id:3
                },{
                    name: '吕星辰4',
					id:4
                }]
            }
        },
        methods:{
            handleSearch() {
                this.loading = true
                setTimeout(() => {
                    this.loading = false
                    this.infoList = this.infoLists
                }, 2000)
            },
            change(val){
                console.log(val.id)
            }
        }
    }
</script>